let fs = require('fs');
let buf = '';

process.stdin.on('readable', function() {
    let chunk = process.stdin.read();
    if (chunk) buf += chunk.toString();
});

process.stdin.on('end', function() {
    let v = buf.split("\n");
    let mod = v[0];
    let vv = [];
    for (let i = 1; i <= 12; ++i) vv.push(v[i].split(" ").map((x)=>{return parseFloat(x);}));
    let sum = 0;
    for (let i = 0; i < 12; ++i)
        for (let j = 10 - i; j >= 0; --j)
            sum += vv[i][j];
    if (mod === "S") {
        console.log(sum.toFixed(1));
    }
    else {
        console.log((sum/66).toFixed(1));
    }
});